<?
$this->placeholder('page_title')->set('MusicBrainz Artists');

$artist_domain = Zupal_Musicbrainz_Artist::getInstance();

$this->headScript()->captureStart();
$artist_domain->render_script('list');
$this->headScript()->captureEnd();
?>
<form  dojoType="dijit.form.Form">
	<dl>

	<dt>Find</dt>

	<dd>
	<input type=text name="search_for" id="find_search_for" style="padding: 4px"
	dojoType="dijit.form.TextBox" style="width: 250px"  />
	<button id="find_button"
	dojoType="dijit.form.Button">Search
    <script type="dojo/method" event="onClick" args="evt">

		sf = dijit.byId('find_search_for');
		search_text = sf.getValue();
		alert('finding ' + search_text);
		q = dijit.byId('list');
		q.setQuery({name: search_text});
			/*, onComplete: function()
		}
		{
			alert("I'm back!");
			dijit.byId('list').setData();
		}}); */
		
	</script>
	</button>
	</dd>

	</dl>
<script type="dojo/method" event="onSubmit">
	return false;
</script>
</form>

<?
echo $artist_domain->render_store('artist_store', ZUPAL_BASEURL . '/media/musicbrainz/artistsdata', 'id');

$artist_domain->render_grid(
	$this,'list', 'artist_store',
	 array(
			'name' => array('label' => 'Artist', 'width' => 180),
			'gid' => array('label' => 'GID', 'width' => 300),
			'begindate' => array('label' => 'b/formed', 'width' => 120),
			'enddate' => array('label' => 'd/ended', 'width' => 120)
		),
		array('onRowClick' => 'artist_row_click')
	);